﻿namespace HRM.CORE.REPORT
{
    using DevExpress.Utils;
    using DevExpress.XtraPrinting;
    using DevExpress.XtraReports.UI;
    using Dictionary.ERP;
    using HRM.CORE;
    using HRM.CORE.CLASS;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Drawing.Printing;

    public class rptTimekeeping : XtraReport
    {
        private BottomMarginBand BottomMargin;
        private IContainer components;
        private DetailBand Detail;
        private DetailBand Detail1;
        private DetailReportBand DetailReport;
        private GroupHeaderBand GroupHeader2;
        private HRM_TIMEKEEPER l_Timekeeper;
        private HRM_TIMEKEEPER_TABLELIST l_TimeKeeperTableList;
        private string m_EmployeeCode;
        private int m_Month;
        private int m_Year;
        private XRPictureBox ptPhoto;
        private ReportFooterBand ReportFooter;
        private ReportHeaderBand ReportHeader;
        private TopMarginBand TopMargin;
        private XRLabel txtAddress;
        private XRLabel txtCompany;
        private XRLabel txtDate;
        private XRTableCell txtEarlyMinute;
        private XRLabel txtEmployeeCode;
        private XRTableCell txtHour;
        private XRLabel txtInformation;
        private XRTableCell txtLateMinute;
        private XRTableCell txtShiftName;
        private XRTableCell txtSymbol;
        private XRTableCell txtTimeIn;
        private XRTableCell txtTimeOut;
        private XRLabel txtTitle;
        private XRRichText txtTotal;
        private XRControlStyle xrControlStyle1;
        private XRControlStyle xrControlStyle2;
        private XRLabel xrLabel2;
        private XRLine xrLine2;
        private XRLine xrLine3;
        private XRTable xrTable1;
        private XRTable xrTable2;
        private XRTableCell xrTableCell14;
        private XRTableCell xrTableCell16;
        private XRTableCell xrTableCell18;
        private XRTableCell xrTableCell19;
        private XRTableCell xrTableCell21;
        private XRTableCell xrTableCell24;
        private XRTableCell xrTableCell4;
        private XRTableRow xrTableRow1;
        private XRTableRow xrTableRow2;

        public rptTimekeeping()
        {
            this.components = null;
            this.l_Timekeeper = new HRM_TIMEKEEPER();
            this.l_TimeKeeperTableList = new HRM_TIMEKEEPER_TABLELIST();
            this.m_EmployeeCode = "";
            this.m_Month = 0;
            this.m_Year = 0;
            this.InitializeComponent();
        }

        public rptTimekeeping(string EmployeeCode, int Month, int Year)
        {
            this.components = null;
            this.l_Timekeeper = new HRM_TIMEKEEPER();
            this.l_TimeKeeperTableList = new HRM_TIMEKEEPER_TABLELIST();
            this.m_EmployeeCode = "";
            this.m_Month = 0;
            this.m_Year = 0;
            this.InitializeComponent();
            this.m_Month = Month;
            this.m_Year = Year;
            this.m_EmployeeCode = EmployeeCode;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(rptTimekeeping));
            this.Detail = new DetailBand();
            this.txtDate = new XRLabel();
            this.txtInformation = new XRLabel();
            this.txtEmployeeCode = new XRLabel();
            this.TopMargin = new TopMarginBand();
            this.BottomMargin = new BottomMarginBand();
            this.ReportHeader = new ReportHeaderBand();
            this.txtTotal = new XRRichText();
            this.xrLine3 = new XRLine();
            this.txtTitle = new XRLabel();
            this.txtAddress = new XRLabel();
            this.ptPhoto = new XRPictureBox();
            this.txtCompany = new XRLabel();
            this.xrLabel2 = new XRLabel();
            this.xrLine2 = new XRLine();
            this.ReportFooter = new ReportFooterBand();
            this.DetailReport = new DetailReportBand();
            this.Detail1 = new DetailBand();
            this.xrTable2 = new XRTable();
            this.xrTableRow2 = new XRTableRow();
            this.txtShiftName = new XRTableCell();
            this.txtTimeIn = new XRTableCell();
            this.txtTimeOut = new XRTableCell();
            this.txtSymbol = new XRTableCell();
            this.txtHour = new XRTableCell();
            this.txtLateMinute = new XRTableCell();
            this.txtEarlyMinute = new XRTableCell();
            this.xrTable1 = new XRTable();
            this.xrTableRow1 = new XRTableRow();
            this.xrTableCell14 = new XRTableCell();
            this.xrTableCell4 = new XRTableCell();
            this.xrTableCell18 = new XRTableCell();
            this.xrTableCell21 = new XRTableCell();
            this.xrTableCell24 = new XRTableCell();
            this.xrTableCell16 = new XRTableCell();
            this.xrTableCell19 = new XRTableCell();
            this.GroupHeader2 = new GroupHeaderBand();
            this.xrControlStyle1 = new XRControlStyle();
            this.xrControlStyle2 = new XRControlStyle();
            this.txtTotal.BeginInit();
            this.xrTable2.BeginInit();
            this.xrTable1.BeginInit();
            this.BeginInit();
            this.Detail.Controls.AddRange(new XRControl[] { this.txtDate });
            this.Detail.HeightF = 17.70833f;
            this.Detail.Name = "Detail";
            this.Detail.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.Detail.TextAlignment = TextAlignment.TopLeft;
            this.txtDate.Borders = BorderSide.Bottom | BorderSide.Right | BorderSide.Left;
            this.txtDate.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.txtDate.ForeColor = Color.FromArgb(0x40, 0x40, 0x40);
            this.txtDate.LocationFloat = new PointFloat(0f, 0f);
            this.txtDate.Name = "txtDate";
            this.txtDate.Padding = new PaddingInfo(4, 4, 0, 0, 100f);
            this.txtDate.SizeF = new SizeF(746.9998f, 17.70833f);
            this.txtDate.StylePriority.UseBorders = false;
            this.txtDate.StylePriority.UseFont = false;
            this.txtDate.StylePriority.UseForeColor = false;
            this.txtDate.StylePriority.UsePadding = false;
            this.txtDate.StylePriority.UseTextAlignment = false;
            this.txtDate.Text = "txtDate";
            this.txtDate.TextAlignment = TextAlignment.MiddleCenter;
            this.txtDate.BeforePrint += new PrintEventHandler(this.txtDate_BeforePrint);
            this.txtInformation.Font = new Font("Times New Roman", 11.25f, FontStyle.Bold);
            this.txtInformation.LocationFloat = new PointFloat(406.375f, 112.6667f);
            this.txtInformation.Name = "txtInformation";
            this.txtInformation.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtInformation.SizeF = new SizeF(340.625f, 18.20833f);
            this.txtInformation.StylePriority.UseFont = false;
            this.txtInformation.StylePriority.UseTextAlignment = false;
            this.txtInformation.Text = "txtInformation";
            this.txtInformation.TextAlignment = TextAlignment.MiddleRight;
            this.txtEmployeeCode.Font = new Font("Times New Roman", 11.25f, FontStyle.Bold);
            this.txtEmployeeCode.LocationFloat = new PointFloat(2.000191f, 113.1666f);
            this.txtEmployeeCode.Name = "txtEmployeeCode";
            this.txtEmployeeCode.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtEmployeeCode.SizeF = new SizeF(360.4167f, 17.70833f);
            this.txtEmployeeCode.StylePriority.UseFont = false;
            this.txtEmployeeCode.Text = "txtEmployeeCode";
            this.TopMargin.HeightF = 40f;
            this.TopMargin.Name = "TopMargin";
            this.TopMargin.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.TopMargin.TextAlignment = TextAlignment.TopLeft;
            this.BottomMargin.HeightF = 40f;
            this.BottomMargin.Name = "BottomMargin";
            this.BottomMargin.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.BottomMargin.TextAlignment = TextAlignment.TopLeft;
            this.ReportHeader.Controls.AddRange(new XRControl[] { this.txtTotal, this.xrLine3, this.txtTitle, this.txtAddress, this.ptPhoto, this.txtCompany, this.xrLabel2, this.txtEmployeeCode, this.txtInformation, this.xrLine2 });
            this.ReportHeader.HeightF = 208f;
            this.ReportHeader.Name = "ReportHeader";
            this.txtTotal.Font = new Font("Times New Roman", 11.25f);
            this.txtTotal.LocationFloat = new PointFloat(0f, 156.125f);
            this.txtTotal.Name = "txtTotal";
            this.txtTotal.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.txtTotal.SerializableRtfString = manager.GetString("txtTotal.SerializableRtfString");
            this.txtTotal.SizeF = new SizeF(746.9998f, 20.29164f);
            this.txtTotal.StylePriority.UseFont = false;
            this.txtTotal.StylePriority.UsePadding = false;
            this.xrLine3.BorderWidth = 0;
            this.xrLine3.ForeColor = Color.Gainsboro;
            this.xrLine3.LocationFloat = new PointFloat(0f, 133.5f);
            this.xrLine3.Name = "xrLine3";
            this.xrLine3.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.xrLine3.SizeF = new SizeF(746.9998f, 6.125015f);
            this.xrLine3.StylePriority.UseBorderWidth = false;
            this.xrLine3.StylePriority.UseForeColor = false;
            this.xrLine3.StylePriority.UsePadding = false;
            this.txtTitle.Font = new Font("Times New Roman", 16f, FontStyle.Bold);
            this.txtTitle.LocationFloat = new PointFloat(3.178914E-05f, 63.33332f);
            this.txtTitle.Name = "txtTitle";
            this.txtTitle.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtTitle.SizeF = new SizeF(746.9998f, 30.25001f);
            this.txtTitle.StylePriority.UseFont = false;
            this.txtTitle.StylePriority.UseTextAlignment = false;
            this.txtTitle.Text = "BẢNG CHI TIẾT CHẤM C\x00d4NG TH\x00c1NG 00/0000";
            this.txtTitle.TextAlignment = TextAlignment.MiddleCenter;
            this.txtAddress.Font = new Font("Times New Roman", 9.75f);
            this.txtAddress.LocationFloat = new PointFloat(144.8751f, 31.70837f);
            this.txtAddress.Name = "txtAddress";
            this.txtAddress.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtAddress.SizeF = new SizeF(590.3128f, 17.70833f);
            this.txtAddress.StylePriority.UseFont = false;
            this.txtAddress.Text = "txtAddress";
            this.ptPhoto.LocationFloat = new PointFloat(4.768372E-05f, 5f);
            this.ptPhoto.Name = "ptPhoto";
            this.ptPhoto.SizeF = new SizeF(88.54166f, 58.33333f);
            this.ptPhoto.Sizing = ImageSizeMode.ZoomImage;
            this.txtCompany.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.txtCompany.LocationFloat = new PointFloat(91.5417f, 10.00001f);
            this.txtCompany.Name = "txtCompany";
            this.txtCompany.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtCompany.SizeF = new SizeF(643.6466f, 17.70833f);
            this.txtCompany.StylePriority.UseFont = false;
            this.txtCompany.Text = "txtCompany";
            this.xrLabel2.Font = new Font("Times New Roman", 9.75f);
            this.xrLabel2.LocationFloat = new PointFloat(91.5417f, 31.70827f);
            this.xrLabel2.Name = "xrLabel2";
            this.xrLabel2.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.xrLabel2.SizeF = new SizeF(53.3334f, 17.70833f);
            this.xrLabel2.StylePriority.UseFont = false;
            this.xrLabel2.Text = "Địa Chỉ:";
            this.xrLine2.BorderWidth = 0;
            this.xrLine2.ForeColor = Color.Gainsboro;
            this.xrLine2.LocationFloat = new PointFloat(0f, 195f);
            this.xrLine2.Name = "xrLine2";
            this.xrLine2.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.xrLine2.SizeF = new SizeF(746.9998f, 3.041712f);
            this.xrLine2.StylePriority.UseBorderWidth = false;
            this.xrLine2.StylePriority.UseForeColor = false;
            this.xrLine2.StylePriority.UsePadding = false;
            this.ReportFooter.HeightF = 16f;
            this.ReportFooter.Name = "ReportFooter";
            this.DetailReport.Bands.AddRange(new Band[] { this.Detail1 });
            this.DetailReport.Level = 0;
            this.DetailReport.Name = "DetailReport";
            this.Detail1.Controls.AddRange(new XRControl[] { this.xrTable2 });
            this.Detail1.HeightF = 19.16666f;
            this.Detail1.Name = "Detail1";
            this.xrTable2.Borders = BorderSide.Bottom | BorderSide.Right | BorderSide.Left;
            this.xrTable2.Font = new Font("Times New Roman", 8.25f);
            this.xrTable2.LocationFloat = new PointFloat(0f, 0f);
            this.xrTable2.Name = "xrTable2";
            this.xrTable2.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.xrTable2.Rows.AddRange(new XRTableRow[] { this.xrTableRow2 });
            this.xrTable2.SizeF = new SizeF(746.9999f, 19.16666f);
            this.xrTable2.StylePriority.UseBorders = false;
            this.xrTable2.StylePriority.UseFont = false;
            this.xrTable2.StylePriority.UsePadding = false;
            this.xrTable2.StylePriority.UseTextAlignment = false;
            this.xrTable2.TextAlignment = TextAlignment.MiddleLeft;
            this.xrTableRow2.Cells.AddRange(new XRTableCell[] { this.txtShiftName, this.txtTimeIn, this.txtTimeOut, this.txtSymbol, this.txtHour, this.txtLateMinute, this.txtEarlyMinute });
            this.xrTableRow2.Font = new Font("Times New Roman", 9.75f);
            this.xrTableRow2.Name = "xrTableRow2";
            this.xrTableRow2.StylePriority.UseFont = false;
            this.xrTableRow2.Weight = 1.0;
            this.txtShiftName.Name = "txtShiftName";
            this.txtShiftName.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.txtShiftName.StylePriority.UsePadding = false;
            this.txtShiftName.StylePriority.UseTextAlignment = false;
            this.txtShiftName.Text = "txtShiftName";
            this.txtShiftName.TextAlignment = TextAlignment.MiddleLeft;
            this.txtShiftName.Weight = 1.2852592644679128;
            this.txtTimeIn.Name = "txtTimeIn";
            this.txtTimeIn.Padding = new PaddingInfo(0, 4, 0, 0, 100f);
            this.txtTimeIn.StylePriority.UsePadding = false;
            this.txtTimeIn.StylePriority.UseTextAlignment = false;
            this.txtTimeIn.Text = "txtTimeIn";
            this.txtTimeIn.TextAlignment = TextAlignment.MiddleCenter;
            this.txtTimeIn.Weight = 0.64647555210412522;
            this.txtTimeIn.BeforePrint += new PrintEventHandler(this.txtTimeIn_BeforePrint);
            this.txtTimeOut.Name = "txtTimeOut";
            this.txtTimeOut.Padding = new PaddingInfo(0, 4, 0, 0, 100f);
            this.txtTimeOut.StylePriority.UsePadding = false;
            this.txtTimeOut.StylePriority.UseTextAlignment = false;
            this.txtTimeOut.Text = "txtTimeOut";
            this.txtTimeOut.TextAlignment = TextAlignment.MiddleCenter;
            this.txtTimeOut.Weight = 0.63915198354152092;
            this.txtTimeOut.BeforePrint += new PrintEventHandler(this.txtTimeOut_BeforePrint);
            this.txtSymbol.Name = "txtSymbol";
            this.txtSymbol.Padding = new PaddingInfo(0, 4, 0, 0, 100f);
            this.txtSymbol.StylePriority.UsePadding = false;
            this.txtSymbol.StylePriority.UseTextAlignment = false;
            this.txtSymbol.Text = "txtSymbol";
            this.txtSymbol.TextAlignment = TextAlignment.MiddleCenter;
            this.txtSymbol.Weight = 0.82663622878093723;
            this.txtSymbol.BeforePrint += new PrintEventHandler(this.txtSymbol_BeforePrint);
            this.txtHour.Name = "txtHour";
            this.txtHour.Padding = new PaddingInfo(0, 4, 0, 0, 100f);
            this.txtHour.StylePriority.UsePadding = false;
            this.txtHour.StylePriority.UseTextAlignment = false;
            this.txtHour.Text = "txtHour";
            this.txtHour.TextAlignment = TextAlignment.MiddleRight;
            this.txtHour.Weight = 0.76942615361546407;
            this.txtLateMinute.Name = "txtLateMinute";
            this.txtLateMinute.Padding = new PaddingInfo(0, 4, 0, 0, 100f);
            this.txtLateMinute.StylePriority.UsePadding = false;
            this.txtLateMinute.StylePriority.UseTextAlignment = false;
            this.txtLateMinute.Text = "txtLateMinute";
            this.txtLateMinute.TextAlignment = TextAlignment.MiddleRight;
            this.txtLateMinute.Weight = 0.71173740466735724;
            this.txtEarlyMinute.Name = "txtEarlyMinute";
            this.txtEarlyMinute.Padding = new PaddingInfo(0, 4, 0, 0, 100f);
            this.txtEarlyMinute.StylePriority.UsePadding = false;
            this.txtEarlyMinute.StylePriority.UseTextAlignment = false;
            this.txtEarlyMinute.Text = "txtEarlyMinute";
            this.txtEarlyMinute.TextAlignment = TextAlignment.MiddleRight;
            this.txtEarlyMinute.Weight = 0.75162417196859177;
            this.xrTable1.AnchorVertical = VerticalAnchorStyles.Bottom;
            this.xrTable1.Borders = BorderSide.All;
            this.xrTable1.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.xrTable1.LocationFloat = new PointFloat(0.0001831055f, 0f);
            this.xrTable1.Name = "xrTable1";
            this.xrTable1.Rows.AddRange(new XRTableRow[] { this.xrTableRow1 });
            this.xrTable1.SizeF = new SizeF(746.9998f, 22.29166f);
            this.xrTable1.StylePriority.UseBorders = false;
            this.xrTable1.StylePriority.UseFont = false;
            this.xrTable1.StylePriority.UseTextAlignment = false;
            this.xrTable1.TextAlignment = TextAlignment.MiddleCenter;
            this.xrTableRow1.BackColor = Color.WhiteSmoke;
            this.xrTableRow1.Cells.AddRange(new XRTableCell[] { this.xrTableCell14, this.xrTableCell4, this.xrTableCell18, this.xrTableCell21, this.xrTableCell24, this.xrTableCell16, this.xrTableCell19 });
            this.xrTableRow1.Name = "xrTableRow1";
            this.xrTableRow1.StylePriority.UseBackColor = false;
            this.xrTableRow1.Weight = 0.40839686814140663;
            this.xrTableCell14.CanGrow = false;
            this.xrTableCell14.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.xrTableCell14.Name = "xrTableCell14";
            this.xrTableCell14.StylePriority.UseFont = false;
            this.xrTableCell14.StylePriority.UseTextAlignment = false;
            this.xrTableCell14.Text = "Ca chấm c\x00f4ng";
            this.xrTableCell14.TextAlignment = TextAlignment.MiddleCenter;
            this.xrTableCell14.Weight = 1.2852584115972983;
            this.xrTableCell4.CanGrow = false;
            this.xrTableCell4.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.xrTableCell4.Name = "xrTableCell4";
            this.xrTableCell4.StylePriority.UseFont = false;
            this.xrTableCell4.StylePriority.UseTextAlignment = false;
            this.xrTableCell4.Text = "Giờ v\x00e0o";
            this.xrTableCell4.TextAlignment = TextAlignment.MiddleCenter;
            this.xrTableCell4.Weight = 0.64647557302820646;
            this.xrTableCell18.CanGrow = false;
            this.xrTableCell18.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.xrTableCell18.Name = "xrTableCell18";
            this.xrTableCell18.StylePriority.UseFont = false;
            this.xrTableCell18.StylePriority.UseTextAlignment = false;
            this.xrTableCell18.Text = "Giờ ra";
            this.xrTableCell18.TextAlignment = TextAlignment.MiddleCenter;
            this.xrTableCell18.Weight = 0.63915274786574638;
            this.xrTableCell21.CanGrow = false;
            this.xrTableCell21.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.xrTableCell21.Name = "xrTableCell21";
            this.xrTableCell21.StylePriority.UseFont = false;
            this.xrTableCell21.StylePriority.UseTextAlignment = false;
            this.xrTableCell21.Text = "K\x00fd hiệu";
            this.xrTableCell21.TextAlignment = TextAlignment.MiddleCenter;
            this.xrTableCell21.Weight = 0.82663655513522494;
            this.xrTableCell24.CanGrow = false;
            this.xrTableCell24.Name = "xrTableCell24";
            this.xrTableCell24.Text = "Tổng giờ";
            this.xrTableCell24.Weight = 0.76942692668142743;
            this.xrTableCell16.CanGrow = false;
            this.xrTableCell16.Name = "xrTableCell16";
            this.xrTableCell16.Text = "Đi trể";
            this.xrTableCell16.Weight = 0.71173726708893037;
            this.xrTableCell19.CanGrow = false;
            this.xrTableCell19.Name = "xrTableCell19";
            this.xrTableCell19.Text = "Về sớm";
            this.xrTableCell19.Weight = 0.75162464498701176;
            this.GroupHeader2.Controls.AddRange(new XRControl[] { this.xrTable1 });
            this.GroupHeader2.HeightF = 22.29166f;
            this.GroupHeader2.Name = "GroupHeader2";
            this.GroupHeader2.RepeatEveryPage = true;
            this.xrControlStyle1.BackColor = Color.Snow;
            this.xrControlStyle1.Name = "xrControlStyle1";
            this.xrControlStyle1.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.xrControlStyle2.BackColor = Color.WhiteSmoke;
            this.xrControlStyle2.Name = "xrControlStyle2";
            this.xrControlStyle2.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            base.Bands.AddRange(new Band[] { this.Detail, this.TopMargin, this.BottomMargin, this.ReportHeader, this.ReportFooter, this.DetailReport, this.GroupHeader2 });
            base.Font = new Font("Times New Roman", 9.75f);
            base.Margins = new Margins(40, 40, 40, 40);
            this.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            base.PageHeight = 0x491;
            base.PageWidth = 0x33b;
            base.PaperKind = PaperKind.A4;
            base.StyleSheet.AddRange(new XRControlStyle[] { this.xrControlStyle1, this.xrControlStyle2 });
            base.Version = "9.3";
            this.BeforePrint += new PrintEventHandler(this.rptListEmployee_BeforePrint);
            this.txtTotal.EndInit();
            this.xrTable2.EndInit();
            this.xrTable1.EndInit();
            this.EndInit();
        }

        private void LoadAllData()
        {
            HRM_EMPLOYEE hrm_employee = new HRM_EMPLOYEE();
            hrm_employee.Get(this.m_EmployeeCode);
            this.txtEmployeeCode.Text = hrm_employee.EmployeeCode + " - " + hrm_employee.FirstName.ToUpper() + " " + hrm_employee.LastName.ToUpper();
            this.txtInformation.Text = "Chức vụ: " + hrm_employee.Position;
            DataSet set = new DataSet();
            DataTable table = new DataTable();
            table = this.l_Timekeeper.GetListDate(this.m_EmployeeCode, this.m_Month, this.m_Year);
            set.Tables.Add(table);
            base.DataSource = set;
            this.txtDate.DataBindings.Add("Text", base.DataSource, "Date");
        }

        private void rptListEmployee_BeforePrint(object sender, PrintEventArgs e)
        {
            this.txtTitle.Text = "BẢNG CHI TIẾT CHẤM C\x00d4NG TH\x00c1NG " + this.m_Month.ToString() + "/" + this.m_Year.ToString();
            this.l_TimeKeeperTableList.Get(this.m_Month, this.m_Year);
            HRM_TIMEKEEPER_TOTAL hrm_timekeeper_total = new HRM_TIMEKEEPER_TOTAL();
            hrm_timekeeper_total.Get(this.l_TimeKeeperTableList.TimeKeeperTableListID, this.m_EmployeeCode);
            string str = "";
            double clockingError = hrm_timekeeper_total.ClockingError;
            double clockingErrorBegin = hrm_timekeeper_total.ClockingErrorBegin;
            double clockingErrorEnd = hrm_timekeeper_total.ClockingErrorEnd;
            if (clockingError > (clockingErrorBegin + clockingErrorEnd))
            {
                str = " - Chấm c\x00f4ng sai: <b><i>" + clockingError.ToString() + "</b> (ng\x00e0y)</i>";
            }
            else if ((clockingErrorBegin > 0.0) && (clockingErrorEnd > 0.0))
            {
                str = " - Kh\x00f4ng chấm v\x00e0o: <b><i>" + clockingErrorBegin.ToString() + "</b> (ng\x00e0y)</i> - Kh\x00f4ng chấm ra: <b><i>" + clockingErrorEnd.ToString() + "</b> (ng\x00e0y)</i>";
            }
            else if ((clockingErrorBegin > 0.0) && (clockingErrorEnd == 0.0))
            {
                str = " - Kh\x00f4ng chấm v\x00e0o: <b><i>" + clockingErrorBegin.ToString() + "</b> (ng\x00e0y)</i>";
            }
            else if ((clockingErrorBegin == 0.0) && (clockingErrorEnd > 0.0))
            {
                str = " - Kh\x00f4ng chấm ra: <b><i>" + clockingErrorEnd.ToString() + "</b> (ng\x00e0y)</i>";
            }
            string str2 = "Tổng giờ l\x00e0m: <b><i>" + hrm_timekeeper_total.TotalHour.ToString() + "</b> (giờ)</i>  - Đi trể: <b><i>" + hrm_timekeeper_total.LateMinute.ToString() + "</b> (ph\x00fat)</i>  - Về sớm: <b><i>" + hrm_timekeeper_total.EarlyMinute.ToString() + "</b> (ph\x00fat)</i></br></br>Tổng ng\x00e0y c\x00f4ng: <b><i>" + hrm_timekeeper_total.WorkTotal.ToString() + "</b> (ng\x00e0y)</i></br>Trong đ\x00f3: </br>  - Ng\x00e0y c\x00f4ng thực tế: <b><i>" + hrm_timekeeper_total.RealDay.ToString() + "</b> (ng\x00e0y)</i>  - Nghỉ chế độ: <b><i>" + hrm_timekeeper_total.RegulationDay.ToString() + "</b> (ng\x00e0y)</i>  - Nghỉ ph\x00e9p năm: <b><i>" + hrm_timekeeper_total.FurloughDay.ToString() + "</b> (ng\x00e0y)</i>  - Nghỉ b\x00f9: <b><i>" + hrm_timekeeper_total.CompensationDay.ToString() + "</b> (ng\x00e0y)</i></br></br>Ng\x00e0y kh\x00f4ng t\x00ednh c\x00f4ng: <b><i>" + hrm_timekeeper_total.Absent.ToString() + "</b> (ng\x00e0y)</i></br>Trong đ\x00f3: </br>  - Nghỉ c\x00f3 l\x00fd do: <b><i>" + hrm_timekeeper_total.AbsentL.ToString() + "</b> (ng\x00e0y)</i>  - Nghỉ kh\x00f4ng l\x00fd do: <b><i>" + hrm_timekeeper_total.AbsentWOL.ToString() + "</b> (ng\x00e0y)</i>" + str + "</br></br>Tổng số giờ tăng ca (đ\x00e3 nh\x00e2n hệ số): <b><i>" + hrm_timekeeper_total.OvertimeTotal1.ToString() + "</b> (giờ)</i></br>Trong đ\x00f3: </br>  - Số giờ tăng ca ng\x00e0y thường: <b><i>" + hrm_timekeeper_total.Overtime150.ToString() + "</b> (giờ)</i>  - Số giờ tăng ca ng\x00e0y chủ nhật: <b><i>" + hrm_timekeeper_total.Overtime200.ToString() + "</b> (giờ)</i>  - Số giờ tăng ca ng\x00e0y lễ: <b><i>" + hrm_timekeeper_total.Overtime300.ToString() + "</b> (giờ)</i></br>  - Số giờ l\x00e0m việc ri\x00eang: <b><i>" + hrm_timekeeper_total.PrivateHour.ToString() + "</b> (giờ)</i></br></br>Số giờ l\x00e0m ca đ\x00eam: <b><i>" + hrm_timekeeper_total.NightHour.ToString() + "</b> (giờ)</i>  - Số ng\x00e0y trực đ\x00eam: <b><i>" + hrm_timekeeper_total.NightDutyDay.ToString() + "</b> (ng\x00e0y)</i>  - Số giờ tăng cường: <b><i>" + hrm_timekeeper_total.ExtraHour.ToString() + "</b> (giờ)</i>";
            DataSet set = new DataSet();
            DataTable table = new DataTable();
            table.Columns.Add("Content");
            table.Rows.Add(new object[] { str2 });
            set.Tables.Add(table);
            base.DataSource = set;
            this.txtTotal.DataBindings.Add(new XRBinding("Html", base.DataSource, "Content"));
            this.LoadAllData();
            //if (MyInfo.Get(MyEncryption.Encrypt("ERP01", "123654", true)) == "OK")
            {
                this.txtCompany.Text = "";//MyInfo.Company.ToUpper();
                this.txtAddress.Text = "";//MyInfo.Address;
                this.ptPhoto.Image = null;//MyInfo.Photo;
            }
            DIC_SYMBOL.CreateReport(this, this.ReportFooter, false, false);
            CreateFooterReport.CreateFooter("IsTimekeeper", this.ReportFooter, this);
        }

        private void txtDate_BeforePrint(object sender, PrintEventArgs e)
        {
            DataSet set = new DataSet();
            DataTable listByDate = new DataTable();
            listByDate = this.l_Timekeeper.GetListByDate(this.m_EmployeeCode, Convert.ToDateTime(this.txtDate.Text));
            set.Tables.Add(listByDate);
            this.DetailReport.DataSource = set;
            this.txtShiftName.DataBindings.Add("Text", this.DetailReport.DataSource, "ShiftName");
            this.txtTimeIn.DataBindings.Add("Text", this.DetailReport.DataSource, "TimeIn");
            this.txtTimeOut.DataBindings.Add("Text", this.DetailReport.DataSource, "TimeOut");
            this.txtSymbol.DataBindings.Add("Text", this.DetailReport.DataSource, "Symbol");
            this.txtHour.DataBindings.Add("Text", this.DetailReport.DataSource, "Hour");
            this.txtLateMinute.DataBindings.Add("Text", this.DetailReport.DataSource, "LateMinute");
            this.txtEarlyMinute.DataBindings.Add("Text", this.DetailReport.DataSource, "EarlyMinute");
            if (Convert.ToDateTime(this.txtDate.Text).DayOfWeek.ToString() == "Sunday")
            {
                this.txtDate.BackColor = Color.Ivory;
            }
            else
            {
                this.txtDate.BackColor = Color.WhiteSmoke;
            }
            this.txtDate.Text = this.ViDateOfWeek(Convert.ToDateTime(this.txtDate.Text).DayOfWeek.ToString()) + ", ng\x00e0y " + Convert.ToDateTime(this.txtDate.Text).ToShortDateString();
        }

        private void txtSymbol_BeforePrint(object sender, PrintEventArgs e)
        {
            if ((this.txtSymbol.Text == "") || (this.txtSymbol.Text == "+"))
            {
                this.txtSymbol.ForeColor = Color.Black;
            }
            else if (((this.txtSymbol.Text == "CS") || (this.txtSymbol.Text == "KCV")) || (this.txtSymbol.Text == "KCR"))
            {
                this.txtSymbol.ForeColor = Color.Red;
            }
            else
            {
                this.txtSymbol.ForeColor = Color.Blue;
            }
        }

        private void txtTimeIn_BeforePrint(object sender, PrintEventArgs e)
        {
            try
            {
                this.txtTimeIn.Text = Convert.ToDateTime(this.txtTimeIn.Text).ToShortTimeString();
            }
            catch
            {
            }
        }

        private void txtTimeOut_BeforePrint(object sender, PrintEventArgs e)
        {
            try
            {
                this.txtTimeOut.Text = Convert.ToDateTime(this.txtTimeOut.Text).ToShortTimeString();
            }
            catch
            {
            }
        }

        private string ViDateOfWeek(string DateName)
        {
            switch (DateName)
            {
                case "Monday":
                    return "Thứ 2";

                case "Tuesday":
                    return "Thứ 3";

                case "Wednesday":
                    return "Thứ 4";

                case "Thursday":
                    return "Thứ 5";

                case "Friday":
                    return "Thứ 6";

                case "Saturday":
                    return "Thứ 7";

                case "Sunday":
                    return "Chủ nhật";
            }
            return "";
        }
    }
}

